from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client
from django.conf import settings

import sys
import logging

logging.basicConfig(level=logging.INFO, stream=sys.stdout)


secret_id = settings.SERCET_ID     # 替换为用户的secret_id
secret_key = settings.SECRET_KEY     # 替换为用户的secret_key
region = 'ap-beijing'    # 替换为用户的region
token = None               # 使用临时密钥需要传入Token，默认为空,可不填
config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token)  # 获取配置对象
client = CosS3Client(config)